<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>demo1</title>
	<script type="text/javascript">
		var person=new Array();
		person.name="xiaoming";
		person.age=12;
		person.sg="2mi";
		person.eat=function(){
			document.write("吃饭啦！");
		}
		console.log(person);
		person.eat();
		console.log(person.da);

		person.da="打架";
		console.log(person.da);

		function animal(){
			this.name="xiaoji";
			this.color="blue";
			this.eat=function(){
				document.write("爱吃饭");
			}
		}
		document.write("<hr>");
		var a=new animal();

		console.log(a);
		a.eat();

document.write("<hr>");


		function mao(){
			this.name="猫咪";
			this.age=2;
			this.eat=function (){
				document.write("吃小鱼干啦");
			}
		}

		q=new mao();
		console.log(q);
		q.eat();
		console.log(q.xizao);
		q.xizao="xizaola";
		console.log(q);
	</script>
</head>
<body>
	
</body>
</html>